export default function debounce (fn,duration = 100){
    var timer = null;
    return (...args)=>{
        clearTimeout(timer);
        timer = setTimeout(()=>{
            fn(...args);
        },duration);
    }
}